/* 同余
* 1.拓展欧几里得算法
    (a,b) = d;
    ax0 + by0 = d

    x = x0 + k(a/d)
    y = y0 - k(b/d)

    ax = 1(mod b)

    ax = (b, a mod b)

* 本题:
    假定两青蛙跳x次后相遇
    A要追B(b-a)米
    每跳一次A追B(m-n)米
        (m-n)x = b-a + y*L // y(st b) L经纬线总长
        环形经纬线，可能多绕

    -> (x0, y0)为一组等式解
    x = x0 + k * (L)/d
    y = y0 + k * (m-n)/d
*/

#define DEBUG
#pragma GCC optimize("O1,O2,O3,Ofast")
#pragma GCC optimize("no-stack-protector,unroll-loops,fast-math,inline")
#pragma GCC target("avx,avx2,fma")
#pragma GCC target("sse,sse2,sse3,sse4,sse4.1,sse4.2,ssse3")

#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

#define int long long

int exgcd(int a, int b, int &x, int &y) //ax+by = gcd(a,b) x,y是整数
{
    if(!b) //此时 gcd(a,0) = a -> ax+by=gcd(a,b) -> x=0,y=1
    {
        x = 1, y = 0;
        return a;
    }

    int d = exgcd(b, a%b, y, x); //gcd(b, a % b) bx' + (a % b)y' = gcd(b, a % b) 
     y -= a / b * x; // x = y'，y = x' - (a / b) * y'
    return d;
}

signed main()
{
    #ifdef DEBUG
        freopen("./in.txt", "r", stdin);
    #else
        ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #endif

    int a, b, m, n, L; cin >> a >> b >> m >> n >> L;

    int x, y;
    int d = exgcd(m-n, L, x, y); // gcd(m-n, L)

    if((b-a)%d) puts("Impossible"); //不能整除
    else {
        x *= (b-a) / d; //之前拿到基础解(右端为0)，这里求特解(右端为y-x)
        int t = abs(L/d);
        cout << (x % t + t) % t << endl;
    }
    return 0;
}